<?php
//包含数据库配置文件
include '../../public/dbconfig.php';
//包含函数库文件
include '../../public/func.inc.php';
//调用函数
$link = conn();
//var_dump($link);
$pname = $_POST['pname'];
$pid = $_POST['pid'];
//var_dump($pid);
//exit;
$sql = "update bbs_part set pname='{$pname}' where id='{$pid}'";
//var_dump($sql);
$res = mysqli_query($link,$sql);
if($res){
	echo '<script>alert("修改成功");window.location.href="list.php";</script>';
}else{
	echo '<script>alert("修改失败");window.location.href="edit.php?pid='.$pid.'";</script>';
	
}
mysqli_close($link);